package edu.hcmiu.portal.model;

import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
import com.liferay.portal.kernel.util.HtmlUtil;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;


public class hook_taglistClp extends BaseModelImpl<hook_taglist>
    implements hook_taglist {
    private long _taglistID;
    private String _taglistName;

    public hook_taglistClp() {
    }

    public long getPrimaryKey() {
        return _taglistID;
    }

    public void setPrimaryKey(long pk) {
        setTaglistID(pk);
    }

    public Serializable getPrimaryKeyObj() {
        return new Long(_taglistID);
    }

    public long getTaglistID() {
        return _taglistID;
    }

    public void setTaglistID(long taglistID) {
        _taglistID = taglistID;
    }

    public String getTaglistName() {
        return _taglistName;
    }

    public void setTaglistName(String taglistName) {
        _taglistName = taglistName;
    }

    public hook_taglist toEscapedModel() {
        if (isEscapedModel()) {
            return this;
        } else {
            hook_taglist model = new hook_taglistClp();

            model.setEscapedModel(true);

            model.setTaglistID(getTaglistID());
            model.setTaglistName(HtmlUtil.escape(getTaglistName()));

            model = (hook_taglist) Proxy.newProxyInstance(hook_taglist.class.getClassLoader(),
                    new Class[] { hook_taglist.class },
                    new ReadOnlyBeanHandler(model));

            return model;
        }
    }

    public Object clone() {
        hook_taglistClp clone = new hook_taglistClp();

        clone.setTaglistID(getTaglistID());
        clone.setTaglistName(getTaglistName());

        return clone;
    }

    public int compareTo(hook_taglist hook_taglist) {
        long pk = hook_taglist.getPrimaryKey();

        if (getPrimaryKey() < pk) {
            return -1;
        } else if (getPrimaryKey() > pk) {
            return 1;
        } else {
            return 0;
        }
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }

        hook_taglistClp hook_taglist = null;

        try {
            hook_taglist = (hook_taglistClp) obj;
        } catch (ClassCastException cce) {
            return false;
        }

        long pk = hook_taglist.getPrimaryKey();

        if (getPrimaryKey() == pk) {
            return true;
        } else {
            return false;
        }
    }

    public int hashCode() {
        return (int) getPrimaryKey();
    }

    public String toString() {
        StringBuilder sb = new StringBuilder();

        sb.append("{taglistID=");
        sb.append(getTaglistID());
        sb.append(", taglistName=");
        sb.append(getTaglistName());
        sb.append("}");

        return sb.toString();
    }

    public String toXmlString() {
        StringBuilder sb = new StringBuilder();

        sb.append("<model><model-name>");
        sb.append("edu.hcmiu.portal.model.hook_taglist");
        sb.append("</model-name>");

        sb.append(
            "<column><column-name>taglistID</column-name><column-value><![CDATA[");
        sb.append(getTaglistID());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>taglistName</column-name><column-value><![CDATA[");
        sb.append(getTaglistName());
        sb.append("]]></column-value></column>");

        sb.append("</model>");

        return sb.toString();
    }
}
